package cn.com.w.mybatisplus.controller;

import cn.com.w.mybatisplus.annotation.UserIdCheck;
import cn.com.w.mybatisplus.domain.UserInfo;
import cn.com.w.mybatisplus.service.IUserInfoService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zhangxiaolong
 * @since 2022-06-22
 */
@Api(tags = "")
@RestController
@RequestMapping("/user-info")
public class UserInfoController {

    @Resource
    private IUserInfoService userInfoService;

    @PostMapping("/update")
    @UserIdCheck
    public String updateUser(UserInfo userInfo){

        return "ok";
    }

    @PostMapping("/getOneByNo")
    public UserInfo getOneByNo(@RequestParam(value = "no") Long userNo){

        return userInfoService.getOneByNo(userNo);
    }

}
